import React, { Component } from 'react';
import { StyleSheet, View,Image,Text,TouchableWithoutFeedback } from 'react-native';
import {txt,view} from '../comm/Size';
import { Card, ListItem, Button } from 'react-native-elements'
import Icon from 'react-native-vector-icons/FontAwesome';
import AppStyle from '../styles/index';

export default class TaskItem extends Component {

    constructor(props) {
        super();
        this.state = {};
    }

    render() {
        const {title,remark,image,recordId}=this.props;

        var source = image ? {uri: image} : require('../assets/placeholder.png');
        return (
                <View style={styles.containerStyle}>
                    <Card
                        containerStyle={{borderRadius: 10,padding:10}}
                        image={source}>
                        <Text style={{marginBottom: 10}}>
                            {title}
                        </Text>
                        <Button
                            onPress={this.props.onPress}
                            icon={{name: 'code'}}
                            backgroundColor={AppStyle.mainColor}
                            fontFamily='Lato'
                            buttonStyle={{borderRadius: 10, marginLeft: 0, marginRight: 0, marginBottom: 0}}
                            title='详情' />
                    </Card>
                </View>
        )
    }
}

const styles = StyleSheet.create({
    containerStyle:{
        marginVertical:view(10)
    }
})
